﻿using Xtensive.Orm;
using Xtensive.Orm.Model;

namespace TypeDiscriminator.Model
{
    [HierarchyRoot(InheritanceSchema.SingleTable)]
    public abstract class Product : Entity
    {
        [Field, Key]
        public int Id { get; set; }

        [Field(Indexed = true, Length = 255)]
        public string Name { get; set; }

        [Field(Indexed = true, Length = 10)]
        [TypeDiscriminator]
        public string Kind { get; set; }

        protected Product(Session session)
            : base(session)
        {
        }
    }
}
